#include "../macro.h"
#include <iostream>
#include <pthread.h>

using std::cout;
using std::endl;

void *func(void *param)
{
    printf("num = %d\n", *(int *)param);
    return (void *)2;
}

int main(int args, char *argv[])
{
    pthread_t thid;
    int num = 1;
    int ret = pthread_create(&thid, nullptr, func, &num);
    PTHREAD_ERR_CHECK(ret, 0, "pthread_create")

    long ans;
    pthread_join(thid, (void **)&ans);
    printf("ans = %ld\n", ans);
    return 0;
}